<html>
   <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="">
<h2 class="comptitle">Simple Module <i>ProbabilisticBroadcast</i></h2>
<b>Package:</b> org.mixim.modules.netw<br/><b>File: <a href="modules-netw-ProbabilisticBroadcast.ned.html">modules/netw/ProbabilisticBroadcast.ned</a></b><br/><p><a href="../doxy/a00028.html" target="mainframe"><b>C++ definition</b></a></p>

<p>Multi-hop ad-hoc data dissemination protocol based on probabilistic broadcast.</p>
<p>This protocol performs network-level broadcast using a probabilistic mechanism.
This method reduces the number of packets sent on the channel (reducing the
broadcast storm problem) at the risk of some nodes not receiving the data.
It is particularly interesting for mobile networks.
Parameter maxNbBcast sets the maximum number of broadcast transmissions of a packet,
parameter beta gives the transmission probability for each attempt,
parameter bcperiod sets the time between two transmission attempts.
Parameter maxFirstBcastBackoff sets a backoff window before first transmission attempt,
and parameter timeInQueueAfterDeath sets the time during which a node remembers
a packet whose time to live (TTL) expired, avoiding retransmitting it in case it comes back
in the network because of some problem.</p>
<img src="org.mixim.modules.netw.ProbabilisticBroadcast-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.modules.netw.ProbabilisticBroadcast.html" title="ProbabilisticBroadcast" alt="ProbabilisticBroadcast" coords="0,0,189,40">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.ProbabilisticBroadcast-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.ProbabilisticBroadcast.html" title="Simple Module ProbabilisticBroadcast" alt="" coords="5,6,157,34">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.ProbabilisticBroadcast-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.ProbabilisticBroadcast.html" title="Simple Module ProbabilisticBroadcast" alt="" coords="31,83,183,111">
<area shape="rect" id="node4" href="org.mixim.modules.netw.AdaptiveProbabilisticBroadcast.html" title="Simple Module AdaptiveProbabilisticBroadcast" alt="" coords="5,161,208,189">
<area shape="rect" id="node2" href="org.mixim.base.modules.BaseNetwLayer.html" title="Simple Module BaseNetwLayer" alt="" coords="49,6,164,34">
</map>
<h3 class="subtitle">Extends:</h3>
<table>
<tr>
   <td>
      <a href="org.mixim.base.modules.BaseNetwLayer.html">BaseNetwLayer</a>
      <i> (simple&nbsp;module)</i>
   </td>
   <td>

<p>Base module for every network layer module</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Known subclasses:</h3>
<table>
<tr>
   <td>
      <a href="org.mixim.modules.netw.AdaptiveProbabilisticBroadcast.html">AdaptiveProbabilisticBroadcast</a>
      <i> (simple&nbsp;module)</i>
   </td>
   <td>

<p>Multi-hop ad-hoc data dissemination protocol based on probabilistic broadcast, with adaptive parameters.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default value</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">notAffectedByHostState</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
   </td>
</tr>
<tr class="inherited">
   <td width="150">coreDebug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>debug switch for core framework</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">stats</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>stats switch</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">headerLength</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>length of the network packet header (in bits)</p>
   </td>
</tr>
<tr class="local">
   <td width="150">debug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
<p>debug and trace switches</p>
   </td>
</tr>
<tr class="local">
   <td width="150">trace</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>   </td>
</tr>
<tr class="local">
   <td width="150">bcperiod</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">2 s</td>
   <td>
<p>period between two probabilistic broadcast attempts</p>
   </td>
</tr>
<tr class="local">
   <td width="150">beta</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">0.8</td>
   <td>
<p>probability of broadcast for each attempt</p>
   </td>
</tr>
<tr class="local">
   <td width="150">maxNbBcast</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">1</td>
   <td>
<p>maximal number of broadcast attempts for each packet.</p>
   </td>
</tr>
<tr class="local">
   <td width="150">maxFirstBcastBackoff</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">1 s</td>
   <td>
<p>maximal back-off before first broadcast attempt [seconds].
if don't want to use this parameter, simply set it
to a value that is greater than bcperiod.</p>
   </td>
</tr>
<tr class="local">
   <td width="150">timeToLive</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">10 s</td>
   <td>   </td>
</tr>
<tr class="local">
   <td width="150">timeInQueueAfterDeath</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">60 s</td>
   <td>
<p>How many seconds the message should be kept in queue after its died.
That way the message is known if the node receives one of its
copy that isn't dead because of TTL de-synchronization due to
MAC backoff, propagation delay and clock drift.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Value</th>
      <th>Description</th>
   </tr>
<tr>
   <td width="150">class</td>
   <td width="100"><i>ProbabilisticBroadcast</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Gates:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Direction</th>
      <th>Size</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">upperGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to uppe layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to lower layer</p>
</td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">// Multi-hop ad-hoc data dissemination protocol based on probabilistic broadcast.
//
// This protocol performs network-level broadcast using a probabilistic mechanism.
// This method reduces the number of packets sent on the channel (reducing the
// broadcast storm problem) at the risk of some nodes not receiving the data.
// It is particularly interesting for mobile networks.
// Parameter maxNbBcast sets the maximum number of broadcast transmissions of a packet,
// parameter beta gives the transmission probability for each attempt,
// parameter bcperiod sets the time between two transmission attempts.
// Parameter maxFirstBcastBackoff sets a backoff window before first transmission attempt,
// and parameter timeInQueueAfterDeath sets the time during which a node remembers
// a packet whose time to live (TTL) expired, avoiding retransmitting it in case it comes back
// in the network because of some problem.
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">ProbabilisticBroadcast</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">BaseNetwLayer</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">ProbabilisticBroadcast</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// debug and trace switches
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">debug</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">trace</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// period between two probabilistic broadcast attempts
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">bcperiod</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">2</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// probability of broadcast for each attempt
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #800080; font-weight: bold; ">beta</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">8</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// maximal number of broadcast attempts for each packet.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">maxNbBcast</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">1</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// maximal back-off before first broadcast attempt [seconds].
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// if don't want to use this parameter, simply set it
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// to a value that is greater than bcperiod.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">maxFirstBcastBackoff</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">1</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);

        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeToLive</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">10</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// How many seconds the message should be kept in queue after its died.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// That way the message is known if the node receives one of its
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// copy that isn't dead because of TTL de-synchronization due to
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// MAC backoff, propagation delay and clock drift.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeInQueueAfterDeath</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">60</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);

}
</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
